Skip to content

Conversation

@tahsinaislam
Copy link
Contributor

Link to pivotal/JIRA issue

Is PM acceptance required?

  • Yes - don't merge until JIRA issue is accepted!

What was done?

  • Took out unique indexing of zip codes to vita partners
  • Fixed the form for adding zip codes to a site on the hub to not check if it is in use by another vita partner
  • Changed the logic within the routing service to account for multiple partners with the same zipcode and randomly pick from the ones that have capacity

How to test?

  • Added in a test for zip code routing for multiple partners

#
# index_vita_partner_zip_codes_on_vita_partner_id (vita_partner_id)
# index_vita_partner_zip_codes_on_zip_code (zip_code) UNIQUE
# index_vita_partner_zip_codes_on_zip_code (zip_code)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needed to take out unique constraint

@github-actions
Copy link

Heroku app: https://gyr-review-app-6110-6085acb231a3.herokuapp.com/
View logs: heroku logs --app gyr-review-app-6110 (optionally add --tail)

expect(page).to have_css('.client-table')
expect(page).to have_css('.client-row', count: 4)

# Default sort order
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was a flaky test, added a wait condition to help things load first before checking the content

it "creates a new vita partner zip code for this partner" do
expect {
post :create, params: params, format: :js, xhr: true
}.to change(vita_partner.serviced_zip_codes, :count).by 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is format: :js, xhr: true doing in this context?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

had to look this up because i copied it from the rest of existing tests, but I think its to retrieve data from a URL without a fill page refresh

@tahsinaislam tahsinaislam merged commit 0736ca3 into main Nov 26, 2025
8 checks passed
@tahsinaislam tahsinaislam deleted the GYR1-808-allow-multiple-partners-to-serve-clients-in-the-same-zip-code branch November 26, 2025 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants